<template>
	<view class="address_add">
		<form @submit="form_submit" class="form-container">
			<view class="padding-main oh">
				<!-- 智能识别 -->
				<!-- <view class="recognition_tip">例:林小姐 136******** xx省xx市xx县/xx街道/xx区 </view>
				<view class="br-main-pair">
					<textarea @input="address_discern_value_event" class="margin-0" placeholder="粘贴整段地址，自动拆分姓名、电话及地址"
						placeholder-class="cr-grey" />
					<cover-view class="auto-discern">
						<button type="default" @tap="address_discern_submit_event">智能识别</button>
					</cover-view>
				</view> -->

				<view class="form-gorup-item-left person_left">
					<view class="form-gorup-title">联系人<text class="form-group-tips-must">*</text></view>
					<input type="text" name="name" :value="address_data.name || ''" maxlength="16"
						placeholder-class="cr-grey" class="cr-base" placeholder="联系人2~16个字符">
				</view>
				<view class="form-gorup-item-right person_left">
					<view class="form-gorup-title">联系电话<text class="form-group-tips-must">*</text></view>
					<input type="text" v-model="address_data.tel" name="tel" maxlength="11" placeholder-class="cr-grey"
						class="cr-base" placeholder="请输入手机号码" @blur="hideTelError">
					<view v-if="telError && telCompleted" class="error-message">{{ telError }}</view>
				</view>
				<!-- 地区 地址 -->
				<view class="position">
					<block v-if="is_user_address_forbid_choice_region == 0">
						<view class="br-b padding-bottom-xs margin-bottom-lg">
							<view class="form-gorup-title oh">
								<text>省市区</text>
								<text class="form-group-tips-must">*</text>
							</view>
							<view class="select-address oh">
								<view class="section fl">
									<picker name="province" @change="select_province_event" :value="province_value"
										:range="province_list" range-key="name">
										<view :class="'name ' + ((province_value == null) ? 'cr-grey' : 'cr-base' )">
											{{((province_list[province_value] || null) == null) ? default_province : province_list[province_value]['name']}}
										</view>
									</picker>
								</view>
								<view class="section fl">
									<picker v-if="(province_id || null) != null" name="city" @change="select_city_event"
										:value="city_value" :range="city_list" range-key="name">
										<view :class="'name ' + ((city_value == null) ? 'cr-grey' : 'cr-base' )">
											{{((city_list[city_value] || null) == null) ? default_city : city_list[city_value]['name']}}
										</view>
									</picker>
									<text v-else class="cr-grey" @tap="region_select_error_event"
										data-value="请先选择省份">请先选择省份</text>
								</view>
								<view class="section fl">
									<picker v-if="(city_id || null) != null" name="county" @change="select_county_event"
										:value="county_value" :range="county_list" range-key="name">
										<view :class="'name ' + ((county_value == null) ? 'cr-grey' : 'cr-base' )">
											{{((county_list[county_value] || null) == null) ? default_county : county_list[county_value]['name']}}
										</view>
									</picker>
									<text v-else class="cr-grey" @tap="region_select_error_event"
										data-value="请先选择城市">请先选择城市</text>
								</view>
							</view>
						</view>
					</block>
					<block v-else>
						<view v-if="(address_data.province_name || null) != null"
							class="br-b padding-bottom-lg margin-bottom-lg">
							{{address_data.province_name}}{{address_data.city_name || ''}}{{address_data.county_name || ''}}
						</view>
					</block>
					<view class="pr padding-bottom-xs">
						<view class="form-gorup-title">详细地址<text class="form-group-tips-must">*</text><text
								v-if="home_user_address_map_status == 1" class="fr form-group-tips">地理位置</text></view>
						<input type="text" name="address" :value="address_data.address || ''" maxlength="80"
							placeholder-class="cr-grey size"
							:class="'cr-base bs-bb '+(home_user_address_map_status == 1 ? 'address-value' : '')"
							placeholder="详细地址1~80个字符">
					</view>
				</view>
				<!-- 标签 -->
				<view class="label_main">
					<!-- 默认地址 -->
					<view class="default-checkbox margin-top-xl" @tap="default_ads_change_event">
						<image class="va-m" :src="address_data.isDefault ? common_static_url_red : common_static_url"
							mode="widthFix"></image>
						<text class="va-m margin-left-sm">设为默认地址</text>
					</view>
				</view>
				<view class="bottom-fixed padding-main">
					<view class="bottom-line-exclude oh">
						<button class="bg-main br-main cr-white round text-size-sm" type="default" form-type="submit"
							hover-class="none" :disabled="form_submit_disabled_status">保存</button>
					</view>
				</view>
			</view>
		</form>
	</view>
</template>

<script>
	const app = getApp();

	export default {
		data() {
			return {
				params: null,
				common_static_url_red: "https://www.moxikeji.com.cn/img/ruoyi/static/app/red/common/select-active-icon.png",
				common_static_url: "https://www.moxikeji.com.cn/img/ruoyi/static/app/red/common/select-icon.png",
				address_data: {},
				province_list: [],
				city_list: [],
				county_list: [],
				province_id: null,
				city_id: null,
				county_id: null,
				idcard_images_data: {},
				default_province: "请选择省",
				default_city: "请选择市",
				default_county: "请选择区/县",
				province_value: null,
				city_value: null,
				county_value: null,
				user_location: null,
				address_discern_value: '',
				form_submit_disabled_status: false,
				region_code_value: '',
				// 基础配置
				home_user_address_map_status: 0,
				home_user_address_idcard_status: 0,
				is_user_address_discern: 0,
				is_user_address_location_discern: 0,
				isDzbhOpen: true,
				isjsOpen: false,
				// isSwitchOn: false,
				data_list_loding_status: 1,
				data_list_loding_msg: '',
				editor_path_type: '',
				is_user_address_forbid_choice_region: 0,
				telError: '请输入有效的手机号码',
				telCompleted: false,
				entryTime: 0
			}
		},
		onShow() {
			// 记录用户进来时间
			this.entryTime = Date.now();
		},
		onUnload() {
			this.OnEntryTime();
		},
		onLoad(params) {
			if (typeof(params) != 'undefined') {
				var numberId = params.numberId || '';
				if (numberId != '') {
					uni.clearStorageSync();
					app.globalData.data.numberId = numberId;
				}
			}
			this.params = params;
			uni.setNavigationBarTitle({
				title: '地址' + (((this.params.id || null) == null) ? '添加' : '编辑')
			});
			this.init();

		},
		// 分享给朋友
		onShareAppMessage(res) {
			return {
				title: app.globalData.data.tenantName,
				path: "pages/user_address_save/user_address_save?numberId=" + app.globalData.data.numberId,
				mpId: app.globalData.data.appid
			}
		},
		// 分享朋友圈
		// onShareTimeline(res) {
		// 	return {
		// 		title: app.globalData.data.tenantName,
		// 		type: 0,
		// 		summary: ""
		// 	}
		// },
		methods: {
			init(e) {
				var user = app.globalData.get_user_info(this, "init", "");
				if (user != false) {
					this.get_data();
					// 初始化配置
					this.init_config();
					this.get_province_list();
				}
			},
			OnEntryTime() {
				var radarlog_data = {
					pageUrl: "pages/user_address_save/user_address_save",
					name: "新增收货地址页",
					remark: "新增收货地址页停留时间",
					entryTime: this.entryTime,
				}
				uni.request({
					url: app.globalData.get_request_url("radarlog/add"),
					data: radarlog_data,
					method: "POST",
					success: (res) => {
						// console.log(res, "新增收货地址页停留时间");
					}
				})
			},
			// 正则检测手机号
			hideTelError() {
				const reg = /^1[3-9]\d{9}$/;
				if (!reg.test(this.address_data.tel)) {
					this.telError = '请输入有效的手机号码'; // 隐藏错误提示
					this.telCompleted = true;
				} else {
					this.telCompleted = false;
				}
			},
			// 初始化配置
			init_config(status) {
				if ((status || false) == true) {
					this.is_user_address_forbid_choice_region = app.globalData.get_config(
						'plugins_base.intellectstools.data.is_user_address_forbid_choice_region', 0)
					this.home_user_address_map_status = app.globalData.get_config('config.home_user_address_map_status');
					this.home_user_address_idcard_status = app.globalData.get_config(
						'config.home_user_address_idcard_status');
					this.is_user_address_discern = app.globalData.get_config(
						'plugins_base.intellectstools.data.is_user_address_discern', 0);
					this.is_user_address_location_discern = app.globalData.get_config(
						'plugins_base.intellectstools.data.is_user_address_location_discern', 0);
				} else {
					app.globalData.is_config(this, 'init_config');
				}
			},
			// 获取数据
			get_data() {
				if ((this.params.id || 0) === 0) {
					return;
				}
				let url = app.globalData.get_request_url("useraddress/detail");
				uni.request({
					url: url,
					method: 'POST',
					data: this.params,
					dataType: 'json',
					success: res => {
						if (res.data.code == 200) {
							var data = res.data || null;
							var ads_data = data.data || null;
							var idcard_images = {
								idcard_front: ads_data == null ? '' : ads_data.idcard_front || '',
								idcard_back: ads_data == null ? '' : ads_data.idcard_back || ''
							};
							this.address_data = ads_data || {};
							this.idcard_images_data = idcard_images;
							this.editor_path_type = data.editor_path_type || '';

							// 数据设置
							if (ads_data != null) {
								this.province_id = ads_data.province || null;
								this.city_id = ads_data.city || null;
								this.county_id = ads_data.county || null;

								// 地理位置
								var lng = ads_data.lng || 0;
								var lat = ads_data.lat || 0;
								if (lng != 0 && lat != 0) {
									this.user_location = {
										lng: lng,
										lat: lat,
										address: ads_data.address || ''
									};
								}
							}

							// 地区数据填充处理
							this.region_data_fill_handle();
						} else {
							if (app.globalData.is_login_check(res.data)) {
								uni.showToast({
									title: res.data.msg
								})
							}
						}
					},
					fail: () => {
						uni.showToast({
							title: "省份信息失败"
						})
					}
				});
			},
			// 地区数据填充处理
			region_data_fill_handle() {
				// 获取城市、区县
				this.get_city_list(true);
				this.get_county_list(true);
			},
			// 省市区未按照顺序选择提示
			region_select_error_event(e) {
				var value = e.currentTarget.dataset.value || null;
				if (value != null) {
					uni.showToast({
						title: value
					})
				}
			},
			// 地区数据初始化
			init_region_value() {
				this.province_value = this.get_region_value("province_list", "province_id");
				this.city_value = this.get_region_value("city_list", "city_id");
				this.county_value = this.get_region_value("county_list", "county_id");
			},
			// 地区初始化匹配索引
			get_region_value(list, id) {
				var data = this[list];
				var data_id = this[id];
				var value = null;
				data.forEach((d, i) => {
					if (d.areaId == data_id) {
						value = i;
						return false;
					}
				});
				return value;
			},
			// 省份事件
			select_province_event(e) {
				var index = e.detail.value || 0;
				if (index >= 0) {
					var data = this.province_list[index];
					this.province_value = index;
					this.province_id = data.areaId;
					this.city_value = null;
					this.county_value = null;
					this.city_id = null;
					this.county_id = null;
					this.get_city_list();
				}
			},
			// 获取省份
			get_province_list() {
				let url = app.globalData.get_request_url("region");
				uni.request({
					url: url,
					method: 'POST',
					data: {},
					dataType: 'json',
					success: res => {
						if (res.data.code == 200) {
							var data = res.data.data;
							this.province_list = data;
						} else {
							uni.showToast({
								title: res.data.msg
							})
						}
					},
					fail: () => {
						uni.showToast({
							title: "省份获取失败"
						})
					}
				});
			},
			// 获取市
			get_city_list(is_init = false, is_parse_city = false) {
				if (this.province_id) {
					let url = app.globalData.get_request_url("region");
					uni.request({
						url: url,
						method: 'POST',
						data: {
							pid: this.province_id
						},
						dataType: 'json',
						success: res => {
							if (res.data.code == 200) {
								var data = res.data.data;
								this.city_list = data

								if (is_init) {
									this.init_region_value();
								}
								if (is_parse_city) {
									this.city();
								}
							} else {
								app.globalData.showToast(res.data.msg);
							}
						},
						fail: () => {
							uni.showToast({
								title: "城市获取失败"
							})
						}
					});
				}
			},
			// 市事件
			select_city_event(e) {
				var index = e.detail.value || 0;
				if (index >= 0) {
					var data = this.city_list[index];
					this.city_value = index;
					this.city_id = data.areaId;
					this.county_value = null;
					this.county_id = null;
					this.get_county_list(true, true);
				}
			},
			// 获取区/县
			get_county_list(is_init = false, is_parse_county = false) {
				if (this.city_id) {
					// 加载loding
					let url = app.globalData.get_request_url("region");
					uni.request({
						url: url,
						method: 'POST',
						data: {
							pid: this.city_id
						},
						dataType: 'json',
						success: res => {
							if (res.data.code == 200) {
								var data = res.data.data;
								this.county_list = data
								if (is_init) {
									this.init_region_value();
								}
								if (is_parse_county) {
									this.county();
								}
							} else {
								uni.showToast({
									title: res.data.msg
								})
							}
						},
						fail: () => {
							uni.showToast({
								title: "区/县获取失败"
							})
						}
					});
				}
			},
			// 区/县事件
			select_county_event(e) {
				var index = e.detail.value || 0;
				if (index >= 0) {
					var data = this.county_list[index];
					this.county_value = index;
					this.county_id = data.areaId;
				}
			},
			// 省
			province() {
				var provinceIndexs = this.province_list.findIndex(item => item.name === this.address_data.province_name);
				var provinceData = this.province_list[provinceIndexs];
				this.province_value = provinceIndexs;
				this.province_id = provinceData.areaId;
				this.city_value = null;
				this.county_value = null;
				this.city_id = null;
				this.county_id = null;
				this.get_city_list(true, true);
			},
			// 市
			city() {
				var cityIndexs = this.city_list.findIndex(item => item.name === this.address_data.city_name);
				if (cityIndexs > 0) {
					var cityData = this.city_list[cityIndexs];
					this.city_value = cityIndexs;
					this.city_id = cityData.areaId;
					this.county_value = null;
					this.county_id = null;
					this.get_county_list(true, true);
				}
			},
			// 区
			county() {
				var countyIndexs = this.county_list.findIndex(item => item.name === this.address_data.county_name);
				if (countyIndexs > 0) {
					var countyData = this.county_list[countyIndexs];
					this.county_value = countyIndexs;
					this.county_id = countyData.areaId;
				}
			},
			// 默认地址设置改变
			default_ads_change_event(e) {
				this.$set(this.address_data, 'isDefault', this.address_data.isDefault ? 0 : 1);
			},
			// 地址信息识别输入事件
			address_discern_value_event(e) {
				this.address_discern_value = e.detail.value;
			},
			// 地址信息识别确认事件
			address_discern_submit_event(e) {
				if ((this.address_discern_value || null) == null) {
					app.globalData.showToast('请先输入地址信息');
					return false
				}
				const address = this.address_discern_value;
				const parsedData = this.parseAddress(address);
				if (parsedData) {
					this.address_data.name = parsedData.name;
					this.address_data.tel = parsedData.phone;
					this.address_data.address = parsedData.address;
					this.address_data.province_name = parsedData.province;
					this.address_data.city_name = parsedData.city;
					this.address_data.county_name = parsedData.county;
				}
				this.address_data = parsedData;
				console.log(this.address_data,'this.address_data');
				this.province();
				// 地址识别处理
				// this.address_discern_handle({address: this.address_discern_value}, 1, 0);
			},
			// 解析地址
			parseAddress(newAddress) {
				const phoneReg = /\d{11}/;
				const phoneMatch = newAddress.match(phoneReg);
				if (!phoneMatch) {
					return null;
				}
				const tel = phoneMatch[0];
				const remainingText = newAddress.replace(tel, '').trim();

				// const nameReg = /^[\u4e00-\u9fa5]+/;
				const nameReg = /^[\u4e00-\u9fa5\(\)\d]+/;
				const nameMatch = remainingText.match(nameReg);
				if (!nameMatch) {
					return null;
				}
				const name = nameMatch[0];
				const address = remainingText.replace(name, '').trim();
				// 去除前面多余的符号
				const cleanedAddress = address.replace(/^[,，\s]+/, '').trim();
				
				const provinceReg = /(省|自治区|特别行政区)/;
				const cityReg = /(市)/;
				const countyReg = /(区|县)/;

				const provinceMatch = cleanedAddress.match(provinceReg);
				const cityMatch = cleanedAddress.match(cityReg);
				const countyMatch = cleanedAddress.match(countyReg);

				const province_name = provinceMatch ? cleanedAddress.substring(0, cleanedAddress.indexOf(provinceMatch[0]) + provinceMatch[0].length) : '';
				const city_name = cityMatch ? cleanedAddress.substring(cleanedAddress.indexOf(provinceMatch ? provinceMatch[0] : '') + (provinceMatch ? provinceMatch[0].length : 0), cleanedAddress.indexOf(cityMatch[0]) + cityMatch[0].length) : '';
				const county_name = countyMatch ? cleanedAddress.substring(cleanedAddress.indexOf(cityMatch ? cityMatch[0] : '') + (cityMatch ? cityMatch[0].length : 0), cleanedAddress.indexOf(countyMatch[0]) + countyMatch[0].length) : '';

				return {
					name: name,
					tel: tel,
					address: cleanedAddress,
					province_name: province_name,
					city_name: city_name,
					county_name: county_name
				};
			},

			// 地址识别处理
			// data 地址信息
			// is_user 是否解析用户信息（0, 1）
			// type 0 用户输入地址信息识别, 1用户选择地理位置识别
			address_discern_handle(data, is_user = 0, type = 0) {
				data['is_user'] = is_user;
				uni.showLoading({
					title: '处理中...',
					mask: true
				});
				let url = app.globalData.get_request_url("address");
				uni.request({
					url: url,
					// url: app.globalData.get_request_url("address", "index", "intellectstools"),
					method: 'POST',
					data: data,
					dataType: 'json',
					success: res => {
						uni.hideLoading();
						if (res.data.code == 0) {
							var temp_ads = this.address_data || {};
							var ads_data = res.data.data;
							var upd_data = {
								province_id: ads_data.province || null,
								city_id: ads_data.city || null,
								county_id: ads_data.county || null,
							}
							// 地址赋值
							var arr = ['province', 'city', 'county', 'province_name', 'city_name',
								'county_name', 'address', 'name', 'tel'
							];
							for (var i in arr) {
								if ((ads_data[arr[i]] || null) != null) {
									temp_ads[arr[i]] = ads_data[arr[i]];
								}
							}

							// 用户手动识别操作
							// 识别成功后清除用户选择的地理位置信息、避免坐标与识别的地址不相符
							if (type == 0) {
								// 已获取的数据置为null
								upd_data['user_location'] = null;
								// 已有的地址坐标也清除
								temp_ads['lng'] = '';
								temp_ads['lat'] = '';
								// 清除位置缓存信息
								this.user_location_remove();
							} else {
								// 地理位置则把名称加入别名
								temp_ads['alias'] = this.user_location.name;
							}
							upd_data['address_data'] = temp_ads;
							// this.upd_data = upd_data
							this.setData(upd_data);

							// 地区数据填充处理
							this.region_data_fill_handle();
						} else {
							if (app.globalData.is_login_check(res.data)) {
								app.globalData.showToast(res.data.msg);
							} else {
								app.globalData.showToast('提交失败，请重试！');
							}
						}
					},
					fail: () => {
						uni.hideLoading();
						app.globalData.showToast('服务器请求出错');
					}
				});
			},
			form_submit(e) {
				// 表单数据
				var form_data = e.detail.value;
				// 加入页面请求参数
				if (this.params) {
					form_data['params'] = this.params;
				}
				// 数据校验
				var validation = [{
						fields: "name",
						msg: "请填写联系人"
					},
					{
						fields: "tel",
						msg: "请填写联系电话",
					},
					{
						fields: "province",
						msg: "请选择省份"
					},
					{
						fields: "city",
						msg: "请选择城市"
					},
					{
						fields: "address",
						msg: "请填写详细地址"
					}
				];
				// 是否开启了地理位置选择
				if (this.home_user_address_map_status == 1) {
					validation.push({
						fields: "lng",
						msg: "请选择地理位置"
					});
					validation.push({
						fields: "lat",
						msg: "请选择地理位置"
					});
				}
				form_data['province'] = this.province_id;
				form_data['provinceName'] = this.province_list[this.province_value].name;
				form_data['city'] = this.city_id;
				form_data['cityName'] = this.city_list[this.city_value]['name'];

				form_data['county'] = this.county_id;
				form_data['countyName'] = this.county_list[this.county_value]['name'];

			
				form_data['addrId'] = this.params.id || 0;
				// 默认地址信息
				var temp_ads = this.address_data || {};
				form_data['isDefault'] = temp_ads.isDefault || 0;
				// 地理位置
				var lng = temp_ads.lng || 0;
				var lat = temp_ads.lat || 0;
				if ((this.user_location || null) != null) {
					lng = this.user_location.lng || 0;
					lat = this.user_location.lat || 0;
				}
				form_data['lng'] = lng;
				form_data['lat'] = lat;
				// 验证提交表单
				if (app.globalData.fields_check(form_data, validation)) {
					// 数据保存
					this.form_submit_disabled_status = true
					uni.showLoading({
						title: '处理中...'
					});
					let url = app.globalData.get_request_url("useraddress/save");
					uni.request({
						url: url,
						method: 'POST',
						data: form_data,
						dataType: 'json',
						success: res => {
							console.log(res,'新增地址');
							uni.hideLoading();
							if (res.data.code == 200) {
								uni.showToast({
									title: res.data.msg
								})
								setTimeout(function() {
									uni.navigateBack();
								}, 1000);
							} else {
								this.form_submit_disabled_status = false
							}
						},
						fail: () => {
							this.form_submit_disabled_status = false
							uni.hideLoading();
							uni.showToast({
								title: "服务器请求出错"
							})
						}
					});
				}
			}
		}
	}
</script>

<style lang="less">
	.recognition_tip{
		font-size: 12px;
		color: red;
		padding-left: 10rpx;
		padding-bottom: 10rpx;
	}
	/* 智能识别 */
	.auto-discern {
		width: 120rpx;
		height: 60rpx;
		border: #c2c2c2 1px solid;
		margin-bottom: 20rpx;
	}

	.auto-discern button {
		width: 120rpx;
		height: 60rpx;
		font-size: 12px;
		display: flex;
		align-items: center;
		justify-content: center;
		background-color: transparent !important;
		color: black;
	}

	.br-main-pair {
		background-color: #f4f4f4;
	}

	.br-main-pair textarea {
		width: 100%;
		padding: 20rpx;
		margin-right: 20rpx;
	}

	.person_left {
		padding-bottom: 50rpx;
	}

	.error-message {
		color: red;
		font-size: 12px;
	}

	.bg-main {
		background-color: #333333 !important;
	}

	.bottom-fixed {
		position: fixed;
		left: 0;
		bottom: 0;
		border: none;
		width: 100%;
		box-sizing: border-box;
		z-index: 2;
	}

	.padding-main {
		padding: 20rpx;
	}

	.bottom-line-exclude {
		padding-bottom: calc(env(safe-area-inset-bottom) - 40rpx);
	}

	.bg-main {
		background-color: #f6c133 !important;
	}

	.br-main {
		border: 1px solid #f6c133 !important;
	}

	.cr-white {
		color: #fff !important;
	}

	.round {
		border-radius: 50rpx !important;
	}

	.text-size-sm {
		font-size: 26rpx !important;
	}

	/**
	 * 表单
	 */
	.form-container .form-gorup {
		padding: 20rpx;
		margin-bottom: 20rpx;
		border-radius: 20rpx;
	}

	.form-container .form-gorup .form-gorup-item-left {
		float: left;
		padding-right: 20rpx;
	}

	.form-container .form-gorup .form-gorup-item-right {
		float: right;
		padding-left: 20rpx;
		border-left: 1px solid #f7f7f7;
	}

	.form-container .form-gorup .form-gorup-item-left,
	.form-container .form-gorup .form-gorup-item-right {
		width: calc(50% - 20rpx - 1px);
	}

	.form-container .form-gorup-submit {
		padding: 20rpx 0;
	}

	.form-container .form-gorup:not(.form-gorup-submit) {
		background: #fff;
	}

	.form-container .form-gorup-title {
		margin-bottom: 4rpx;
		font-weight: 500;
	}

	.size {
		font-size: 12px;
	}

	.form-container .form-group-tips,
	.form-container .form-group-tips-must {
		margin-left: 20rpx;
		font-size: 24rpx;
		color: #ccc;
	}

	.form-container .form-group-tips-must {
		color: #f00;
	}

	.form-container .form-gorup input,
	.form-container .form-gorup textarea,
	.form-container .form-gorup .picker {
		border-radius: 0;
		width: 100%;
		box-sizing: border-box;
		font-size: 28rpx;
	}

	.form-container .form-gorup input,
	.form-container .form-gorup .picker,
	.form-container .form-gorup .radio-gorup {
		height: 70rpx;
		line-height: 70rpx;
	}

	.form-container .form-gorup textarea {
		padding: 0;
		height: 150rpx !important;
		margin-top: 20rpx;
	}

	.form-container .form-gorup-text {
		padding: 20rpx 10rpx;
	}

	.form-container .form-gorup .switch {
		margin: 30rpx 0 20rpx 0;
	}

	.form-container .form-gorup .radio-gorup .radio radio {
		transform: scale(0.7);
	}

	.form-container .form-gorup .radio-gorup .radio:not(:last-child) {
		margin-right: 50rpx;
	}

	.br-b {
		border-bottom: 1px solid #f7f7f7 !important;
	}

	.padding-bottom-xs {
		padding-bottom: 20rpx;
	}

	.margin-bottom-lg {
		margin-bottom: 20rpx;
	}

	.form-gorup-title {
		margin-bottom: 20rpx;
	}

	.oh {
		overflow: hidden;
	}

	.form-group-tips-must {
		margin-left: 20rpx;
		font-size: 24rpx;
		color: #f00;
	}

	.select-address {
		box-sizing: border-box;
		height: 70rpx;
		line-height: 70rpx;
		padding: 0 10rpx;
	}

	.select-address .section {
		width: 33.33%;
		box-sizing: border-box;
	}

	.select-address .section:not(:first-child) {
		padding: 0 5rpx;
	}

	.fl {
		float: left;
	}

	.cr-grey {
		color: #9A9A9A !important;
	}

	.cr-base {
		color: #666 !important;
	}

	.padding-bottom-lg {
		padding-bottom: 20rpx;
	}

	.margin-bottom-lg {
		margin-bottom: 20rpx;
	}

	.bs-bb {
		box-sizing: border-box;
	}

	.map-icon {
		bottom: 0;
		right: 0;
		width: 90rpx;
		height: 80rpx;
		line-height: 80rpx;
	}

	.pa {
		position: absolute;
	}

	.pr {
		position: relative;
	}

	.cp {
		/* #ifdef H5 */
		cursor: pointer;
		/* #endif */
	}

	.tc {
		text-align: center;
	}

	/**
	 * 地址信息
	 */
	.default-checkbox image {
		width: 35rpx;
		height: 35rpx !important;
		// background-color: #ccc;
	}

	.margin-top-xl {
		margin-top: 25rpx;
	}

	.va-m {
		vertical-align: middle;
	}

	.margin-left-sm {
		margin-left: 10rpx;
		padding-bottom: 20rpx !important;
	}

	page {
		background-color: white;
	}

	.red {
		color: #ff3660;
	}

	.dlwz {
		margin-left: 10rpx;
	}

	.active {
		background-color: #333333;
		color: white;
		border-radius: 20px;
	}

	.switchOn {
		background-color: skyblue !important;
	}
</style>